﻿<?php 

    include 'loginYanZheng.php';

    weiDengLu();


 ?>

 <!DOCTYPE html>
 <html>
 <head>
 	<title>令牌管理</title>
	<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css">

    <style type="text/css">
    	
    	.box{
    		width:60%;
    		margin:50px auto;
    	}
    	.layui-table-header .layui-table thead tr{
  
    		background-color: black;
    	}
    	.layui-table-header .layui-table thead tr th{
    		text-align: center;
    		color:#fff;
    		font-size:20px;
    		font-weight: bold;

    	}
    	.layui-table-body .layui-table  tr td{

    		text-align: center;

    		color:black;

    		font-size: 18px;

    		border:none;

    		border-bottom:solid 3px;

    	}

    	.layui-table-body .layui-table  tr {

    		height: 120px;

    	}

    	.layui-border-box{

    		border:none;
    	}

    	.box{

    		margin-bottom:10px;
    	}
    	.box .urlList .url_item{
    		font-size:20px;
    		margin-left:10px;
    		float:left;
    	}
    	.box .urlList .clear{
    		clear: both;
    	}
    	.fanhui{

    		margin-top:30px;

    		padding-left:30px;
    	}
    </style>

 </head>

 <body>	
  	<div class="fanhui">
	              
      	<a href="jiemian.php"><i class="layui-icon layui-icon-left" style="font-size:20px"></i><div class="doc-icon-name">返回</div></a>

  	</div>
  	<hr>
 	<div class="box">
 		<div class="urlList">
 			<div class="url_item">
 				<a href="https://wechat.xiaoliebian.com/#/login" target="_black">小裂变网站</a>
 			</div>
 			<div class="url_item">
 				<a href="https://uworker.yunque360.com/login" target="_black">云雀网站</a>
 			</div>
 			<div class="url_item">
 				<a href="AIboot/baiying/baiyingSDK/open-sdk-php/GetTokenDemo.php" target="_black">百应toke</a>
 			</div>
	 		<div class="clear">
 				
			</div>
 			
 		</div>

 		<table id="table1" lay-filter="test"></table>
 	</div>
 </body>
 <script src="layui/layui.all.js"></script>
 <script type="text/javascript">

 		var table=layui.table;

			table.render({

				elem:'#table1',
				url:'mingxi.php',
				method:'post',
				where:{'type':41},
				limit:20,
				cols:[[

					 {field: 'name_g', title: '名称'}
					,{field: 'toke', title: '令牌',edit:'text'}

				]],
				
			})

			table.on('edit(test)', function(obj){ //注：edit是固定事件名，test是table原始容器的属性 lay-filter="对应的值"
			  console.log(obj.value); //得到修改后的值
			  console.log(obj.field); //当前编辑的字段名
			  console.log(obj.data); //所在行的所有相关数据  
			  obj.data.type=42;
			  $.post('mingxi.php',obj.data,function(data){

			  		

			  		data=JSON.parse(data)

			  		console.log(data)

			  		var layer=layui.layer

			  		layer.msg(data.msg)


			  })
			});
 	
 </script>
 </html>